package com.bluej.redis.demo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.bluej.redis.tools.RedisUtil2;

public class Start2 {

	private static ApplicationContext ac;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ac = new ClassPathXmlApplicationContext(new String[]{"spring-redis2.xml"});

		RedisUtil2 redisUtil2 =ac.getBean("redisUtil2", RedisUtil2.class);
		int a=1;
		while(true){
			redisUtil2.set("mykey", "dd");
			String value =redisUtil2.get("mykey");
			System.out.println(value);
			System.out.println(a);
			if(a++==2){
				break;
			}
		}
		
	}

}
